package com.feige.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.feige.pojo.PrivateChatMsg;
import com.feige.pojo.vo.ChatMsgVo;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 聊天消息表 Mapper 接口
 * </p>
 *
 * @author feige
 * @since 2020-12-26
 */

@Repository
public interface PrivateChatMsgMapper extends BaseMapper<PrivateChatMsg> {

    /**
     * 查询聊天消息
     * @param map
     * @return
     */
    List<ChatMsgVo> queryChatMsg(Map<String, Object> map);

    /**
     * 查询聊天消息总数
     * @param map
     * @return
     */
    int queryChatMsgTotal(Map<String, Object> map);

    /**
     * 更新消息为已读
     * @param msgIdList
     * @return
     */
    int batchUpdateChatMsg(List<String> msgIdList);

    /**
     * 查询未签收的消息
     * @param receiverId
     * @return
     */
    List<ChatMsgVo> queryUnsignMsg(String receiverId);


}
